<!--
 * @Author: luoqi
 * @Date: 2022-03-07 19:27:29
 * @LastEditors: luoqi
 * @LastEditTime: 2022-05-03 22:32:33
 * @Description: 
-->
<template>
  <div>
    <el-row class="top">
      <el-col :span="2">共<span class="num">{{num}}</span>条</el-col>
      <el-col :span="3" :offset="19"><div class="btn" @click="release"><i class="iconfont icon-bianji"></i>发布经验</div></el-col>
    </el-row>
    <Exprec :expList="expList" :isMy="true" :showDel="true"></Exprec>
  </div>
</template>

<script>
import Exprec from "../components/Exprec.vue";
export default {
  components:{
    Exprec
  },
  props:['showDel'],
data(){
  return{
    num:0,
    expList:[]
  }
},
methods:{
  release(){
    this.$router.push('/main/releaseexp')
  }
},
created(){
this.$axios({
      url: "/experience/selectByType",
      method: "get",
      params: {
        author:this.$getStorage("userinfo").nickname,
        page: 1,
        size: 6,
        userId:this.$getStorage("userinfo").id,
        status:1
      },
    }).then((res) => {
      console.log(res);
      if (res.code == "200") {
        this.expList = res.data;
        this.num=res.data.length
      }
    });
}
}
</script>

<style lang="less" scoped>
.top{
  line-height: 40px;
  margin-bottom: 20px;
  .num{
    font-size: 25px;
    color: #312a6d;
  }
.btn {
    height: 40px;
    background-color: #312a6d;
    border-radius: 5px;
    color: #f2f7fb;
    line-height: 40px;
    font-size: 18px;
    user-select: none;
    i {
      margin-right: 5px;
    }
  }
}

</style>